/**
 *
 * Copyright 2012 TeleNav, Inc. All rights reserved.
 * EvaluationRequest.java
 *
 */
package com.telenav.snowsweeper.net;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import com.telenav.snowsweeper.UrlsOfServer;

/**
 *@author hhzhu
 *@date 2012-12-7
 */
public class EvaluationRequest extends AbstractRequest
{
    private int level;
    private long timestamp;
    private String route;
    
    public EvaluationRequest(ICallBack caller, int level, long timestamp, String route)
    {
        super(caller);
        this.level = level;
        this.timestamp = timestamp;
        this.route = route;
    }
    
    @Override
	public String getRequestUrl() {
    	String s = "";
		try {
			s = UrlsOfServer.getInsttance().getURLByType(UrlsOfServer.TYPE_CONFIG_EVALUATION) + "?level=" + level
					+ "&timestamp=" + timestamp + (route == null ? "" : ("&route=" + URLEncoder.encode(route, "UTF-8")));
			
		}
		catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} 
		return s;
	}

}
